package guet.dream.tryftl;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import guet.dream.common.freemarker.BaseControllerServlet;
import guet.dream.common.freemarker.Page;

public class TestBaseServlet extends BaseControllerServlet {

	private ArrayList<Book> books = new ArrayList<Book>();
	
	public void indexAction(HttpServletRequest request,Page p){
		List snapShot;
		Book book = new Book("java in action","banxi1988");
		books.add(book);
		books.add(new Book("Hibernate in Action ","Gavin King"));
		books.add(new Book("Test Driven Development","iyan"));
		synchronized(books){
			snapShot = (List)books.clone();
		}
		p.put("books", snapShot);
		p.setTemplate("index.ftl");
	}
}
